package com.qeng.aiwanba.util;


import android.content.Context;

import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;

/**
 * Created by lixy on 17/3/10.
 */

public class MyWxApiManager {
    private IWXAPI iwxapi;
    private static MyWxApiManager instance;

    public static MyWxApiManager getInstance(){
        if(instance == null){
            instance = new MyWxApiManager();
        }
        return instance;
    }

    public IWXAPI getIwxapi(Context context){
        if(iwxapi == null){
            iwxapi = WXAPIFactory.createWXAPI(context,Constants.WECHAT_APP_ID);
            iwxapi.registerApp(Constants.WECHAT_APP_ID);
        }
        return iwxapi;
    }
}
